﻿using System.Data.SqlClient;

namespace SeventhHabit.Dbm.Model {
    public class SqlServerDatabase : VersionedDatabaseBase {
        #region C'tors

        public SqlServerDatabase(string connectionString)
            : base(connectionString) {
            using (var connection = new SqlConnection(ConnectionString)) {
                if (SchemaChangeLogTableExists(connection))
                    RetrieveReleaseNumbers(connection);
            }
        }

        #endregion

        #region Instance Methods

        public override void ExecuteScripts(string[] sqlScripts, bool transactional) {
            using (var connection = new SqlConnection(ConnectionString))
                ExecuteScriptsBase(connection, sqlScripts, transactional);
        }

        #endregion
    }
}